let d = document;
let user = d.querySelector("header .user");

// 判断是否登陆
if (!isLogin()) {
  window.location.href = "login.html"
} else {
  // 以登陆，头部添加上用户名和添加其他标签
  let userC = `
    <span>用户：${sessionStorage.getItem("user_session")}</span>
    <span class="quit">退出</span>
  `;
  user.innerHTML += userC;
  if (!IsPC()) {
    user.querySelector(".quit").addEventListener("touchend", quitToLogin)
  } else {
    user.querySelector(".quit").addEventListener("click", quitToLogin)
  }
}

